home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 163 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: phoenix.rhein.de!yaps!arno
  2. From: arno@yaps.rhein.de (Arno Eigenwillig)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Exec Lists once again
  5. Message-ID: <aiGTx*gXe@yaps.rhein.de>
  6. Date: Wed, 03 Jan 1996 20:14:02 +0100
  7. References: <zp0e60aC1XREZf0@pp78hsp.hsp.owl.de>
  8. Organization: Yet Another Private Site in Meckenheim, Germany
  9. MIME-Version: 1.0
  10. Content-Type: text/plain; charset=ISO-8859-1
  11. Content-Transfer-Encoding: 8bit
  12. X-Copyright: This article may not be distributed on a CD-ROM
  13.  or in printed form without prior written consent of the author.
  14. X-Disclaimer: 30 hours awake now.
  15. X-Newsreader: Arn V 1.04
  16.  
  17. In article <zp0e60aC1XREZf0@pp78hsp.hsp.owl.de>, Thomas Eicher writes:
  18.  
  19. >       while (np->ln_Pred != namelist.lh_TailPred)
  20.  
  21. That is correct.
  22.  
  23. >       while (np! = namelist.lh_Tail)
  24.         while (np != namelist.lh_Tail)   I suppose
  25.  
  26. lh_Tail is always zero. What you really mean ("while np isn't the
  27. terminating peuso-node") is
  28.  
  29.         while ((APTR)np != (APTR)(&namelist.lh_Tail))
  30.  
  31. What I personally prefer, though, is
  32.  
  33.         while (np->ln_Succ)
  34.  
  35. The shorter, the sweeter. ;) And it is a method that even works in
  36. case you have an only forward-linked list (which is a sensible thing
  37. in some list sort algorithms: Treat the list as forward-linked and add
  38. the expensive backward-linking when sorting has finished.)
  39.  
  40. -- __
  41. __/// Arno Eigenwillig /\ <arno@yaps.rhein.de> \/  PGP key
  42. \XX/   V+49-2225-5870  /\ <Arnooo @ #amigager> \/ available
  43.